/**
 * <strong>Title : WCCapacityCoefficient.java<br>
 * </strong> <strong>Package : cn.b.sky.mes.cm.model<br>
 * </strong> <strong>Description : </strong>@类注释说明写在此处@<br>
 * <strong>Create on : 2016年1月13日 上午10:57:47<br>
 * </strong>
 * <p>
 * @author dapeng.li<br>
 * @version <strong>v1.0.0</strong><br>
 * <br>
 *          <strong>修改历史:</strong><br>
 *          修改人 | 修改日期 | 修改描述<br>
 *          -------------------------------------------<br>
 * <br>
 * <br>
 */
package cn.b.sky.mes.cm.model;

import cn.b.sky.common.model.ImeCommon;

/**
 * <strong>Title : WCCapacityCoefficient.java<br>
 * </strong> <strong>Package : cn.b.sky.mes.cm.model<br>
 * </strong> <strong>Description : </strong>工作中心产能系数<br>
 * <strong>Create on : 2016年1月13日 上午10:57:47<br>
 * </strong>
 * <p>
 * 
 * @author dapeng.li<br>
 * @version <strong>v1.0.0</strong><br>
 *          <br>
 *          <strong>修改历史:</strong><br>
 *          修改人 | 修改日期 | 修改描述<br>
 *          -------------------------------------------<br>
 *          <br>
 *          <br>
 */
public class WCCapacityCoefficient extends ImeCommon implements Comparable<WCCapacityCoefficient> {

  /**
   * 工作中心编号
   */
  private String workCenterCode;

  /**
   * 序号
   */
  private Integer ordinal;

  /**
   * 下限量
   */
  private Integer lowerQuantity;

  /**
   * 上限量
   */
  private Integer upperQuantity;

  /**
   * 产能系数
   */
  private Float coefficient;

  /**
   * @return workCenterCode
   */
  public String getWorkCenterCode() {
    return workCenterCode;
  }

  /**
   * @param workCenterCode
   *            要设置的 workCenterCode
   */
  public void setWorkCenterCode(String workCenterCode) {
    this.workCenterCode = workCenterCode;
  }

  /**
   * @return ordinal
   */
  public Integer getOrdinal() {
    return ordinal;
  }

  /**
   * @param ordinal
   *            要设置的 ordinal
   */
  public void setOrdinal(Integer ordinal) {
    this.ordinal = ordinal;
  }

  /**
   * @return lowerQuantity
   */
  public Integer getLowerQuantity() {
    return lowerQuantity;
  }

  /**
   * @param lowerQuantity
   *            要设置的 lowerQuantity
   */
  public void setLowerQuantity(Integer lowerQuantity) {
    this.lowerQuantity = lowerQuantity;
  }

  /**
   * @return upperQuantity
   */
  public Integer getUpperQuantity() {
    return upperQuantity;
  }

  /**
   * @param upperQuantity
   *            要设置的 upperQuantity
   */
  public void setUpperQuantity(Integer upperQuantity) {
    this.upperQuantity = upperQuantity;
  }

  /**
   * @return coefficient
   */
  public Float getCoefficient() {
    return coefficient;
  }

  /**
   * @param coefficient
   *            要设置的 coefficient
   */
  public void setCoefficient(Float coefficient) {
    this.coefficient = coefficient;
  }

  @Override
  public int compareTo(WCCapacityCoefficient o) {
    if (this.lowerQuantity == null || o.upperQuantity == null) {
      return -1;
    } else if (this.upperQuantity == null || o.lowerQuantity == null) {
      return 1;
    } else {
      return this.lowerQuantity - o.lowerQuantity;
    }
  }

  @Override
  public int hashCode() {
    final int prime = 31;
    int result = 1;
    result = prime * result + ((coefficient == null) ? 0 : coefficient.hashCode());
    result = prime * result + ((lowerQuantity == null) ? 0 : lowerQuantity.hashCode());
    result = prime * result + ((ordinal == null) ? 0 : ordinal.hashCode());
    result = prime * result + ((upperQuantity == null) ? 0 : upperQuantity.hashCode());
    result = prime * result + ((workCenterCode == null) ? 0 : workCenterCode.hashCode());
    return result;
  }

  @Override
  public boolean equals(Object obj) {
    if (this == obj) {
      return true;
    }
    if (obj == null) {
      return false;
    }
    if (getClass() != obj.getClass()) {
      return false;
    }
    WCCapacityCoefficient other = (WCCapacityCoefficient) obj;
    if (coefficient == null) {
      if (other.coefficient != null) {
        return false;
      }
    } else if (!coefficient.equals(other.coefficient)) {
      return false;
    }
    if (lowerQuantity == null) {
      if (other.lowerQuantity != null) {
        return false;
      }
    } else if (!lowerQuantity.equals(other.lowerQuantity)) {
      return false;
    }
    if (ordinal == null) {
      if (other.ordinal != null) {
        return false;
      }
    } else if (!ordinal.equals(other.ordinal)) {
      return false;
    }
    if (upperQuantity == null) {
      if (other.upperQuantity != null) {
        return false;
      }
    } else if (!upperQuantity.equals(other.upperQuantity)) {
      return false;
    }
    if (workCenterCode == null) {
      if (other.workCenterCode != null) {
        return false;
      }
    } else if (!workCenterCode.equals(other.workCenterCode)) {
      return false;
    }
    return true;
  }

}
